<?php

//error_reporting(E_ALL);
//ini_set('display_errors','On');
$twitter_json = json_decode(file_get_contents ("http://api.twitter.com/1/statuses/user_timeline.json?screen_name=prclatest&count=6"),true);


foreach ($twitter_json as $twitter=>$t) {
    
        $text = split("http",   $t["text"]);
        $url = "http" . $text[count($text)-1];
	echo<<<STOP
	<div id={$t["id_str"]} style=display:none>
	<div><a class=twitter_link href="{$url}"> {$t["text"]}</a></div>
	<div>{$t["created_at"]}</div>
	</div>
STOP;
}
?>
<script type="text/javascript">
<!--
function loop_twitter () {
<?php 
$i=0;
foreach ($twitter_json as $twitter=>$t) {
	echo<<<STOP
	$("#{$t["id_str"]}").delay(3500*{$i}).slideDown("slow").delay(6000).slideUp("slow");	
STOP;
	$i++;
}
echo<<<STOP
setTimeout("loop_twitter ()",3500*{$i});
STOP;
?>
}

loop_twitter ()
//-->
</script>

	